/**
 * Created by hao.cheng on 2017/4/15.
 */
import React from 'react';
import { Row, Col, Card } from 'antd'; 
import BasicTable from './BasicTable';
import SelectTable from './SelectTable';
import SortTable from './SortTable';
import SearchTable from './SearchTable';
import BreadcrumbCustom from '../BreadcrumbCustom';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { getNewsList } from '@/action';  

class NewsTables extends React.Component {
    componentWillMount() {

        const { getNewsList} = this.props;
        console.log(this.props) 
         
        getNewsList({funcName: 'getNewsList', stateName: 'newsState'});
    }
    componentDidUpdate(prevProps) {}
    handleSubmit = (e) => {};

    render() {

        return (
            <div className="gutter-example">
                <BreadcrumbCustom first="表格" second="基础表格" />
                <Row gutter={16}>
                    <Col className="gutter-row" md={24}>
                        <div className="gutter-box">
                            <Card title="基础表格" bordered={false}>
                                <BasicTable />
                            </Card>
                        </div>
                    </Col>
                </Row>
                <Row gutter={16}>
                    <Col className="gutter-row" md={24}>
                        <div className="gutter-box">
                            <Card title="基础表格" bordered={false}>
                                <SelectTable />
                            </Card>
                        </div>
                    </Col>
                </Row>
                <Row gutter={16}>
                    <Col className="gutter-row" md={12}>
                        <div className="gutter-box">
                            <Card title="可控的筛选和排序" bordered={false}>
                                <SortTable />
                            </Card>
                        </div>
                    </Col>
                    <Col className="gutter-row" md={12}>
                        <div className="gutter-box">
                            <Card title="自定义筛选" bordered={false}>
                                <SearchTable />
                            </Card>
                        </div>
                    </Col>
                </Row>
            </div>
        )
    }
}

const mapDispatchToProps = dispatch => ({
    getNewsList: bindActionCreators(getNewsList, dispatch)
});

const mapStateToPorps = state => {
    const { news } = state.getNewsData;
    console.log('state.httpData123333333443')
    console.log(state)
    return { news };
}; 
//export default NewsTables;
export default connect(mapStateToPorps, mapDispatchToProps)(NewsTables);
 